<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:p="http://primefaces.org/ui"
	template="/templates/layout.xhtml">
	
	<ui:define name="head"></ui:define>
	
	<ui:define name="ptitle">开票单查询</ui:define>
	
	<ui:define name="pcontent">
	<h:form id="frm6"> 
		<h:panelGrid columns="8" cellspacing="10">	
			<p:outputLabel value="开票编号" />
			<p:inputText  value="#{invInfoQueryMB.io.invId}" />
			<p:outputLabel value="开票日期" />
			<p:calendar locale="zh" navigator="true"  value="#{invInfoQueryMB.io.invDate}" 
					pattern="yyyy-MM-dd" mask="true"  mode="popup"	showOn="button" popupIconOnly="true"
					required="false" requiredMessage="请款日期必须输入" />
			<p:outputLabel value="合同编号" />
			<p:inputText value="#{invInfoQueryMB.io.bmeContract.id}" />
 			<p:outputLabel value="合同名称" />
			<p:inputText value="#{invInfoQueryMB.io.contName}" />
			<p:outputLabel value="开票状态" />
			<p:selectOneMenu value="#{invInfoQueryMB.io.status}" effect="fold" style="width:80%;"> 
				<f:selectItem itemLabel="请选择..." itemValue=""/>
				<f:selectItems value="#{invInfoQueryMB.itemsInvStatus}" />
			</p:selectOneMenu>	
				
            <p:commandButton value="查询开票"	icon="ui-icon-search"  
				action="#{invInfoQueryMB.queryAction}"  update=":frm7 ">
			</p:commandButton>		
		</h:panelGrid>
	</h:form>

	<h:form id="frm7">
		<p:growl id="msgs1" showDetail="true" />
		<p:panel id="contPanel" header="开票单信息" style="margin-bottom:5px">
			
			<p:dataTable id="rdt" value="#{invInfoQueryMB.voi}"  var="row"  rowIndexVar="rowNum"
				style="margin-bottom:5px"
				scrollable="true" scrollWidth="98%" 
				paginator="true" paginatorPosition="bottom" rows="8" 
                paginatorTemplate="{Exporters} {CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" 
                rowsPerPageTemplate="5,10,15"  emptyMessage="没有记录" >
				
				<f:facet name="header">开票单信息</f:facet>
				
				<f:facet name="{Exporters}">
		            <h:commandLink title="导出XLS">
		                <p:graphicImage name="/images/xls.png" width="16" height="16"/>
		                <p:dataExporter type="xls" target="rdt" fileName="contracts" />
		            </h:commandLink>		 
		        </f:facet>

				<p:column headerText="No."  width="20"  exportable="false">
					#{rowNum+1}
				</p:column>
				<p:column headerText="开票编号"  width="100" sortBy="#{row.id}">
					<h:outputText value="#{row.invId}" />
				</p:column>
				<p:column headerText="开票日期" width="100" >
					<h:outputText value="#{row.invDate}" />
				</p:column>
				<p:column headerText="合同编号" width="130" >
					<h:outputText value="#{row.bmeContract.id}" />
				</p:column>
				<p:column headerText="合同名称" width="100" >
					<h:outputText value="#{row.bmeContract.name}" />
				</p:column>
				<p:column headerText="客户名称" width="100" >
					<h:outputText value="#{row.custName}" />
				</p:column>
				<p:column headerText="请款单编号" width="100" >
					<h:outputText value="#{row.bmePayroll.id}" />
				</p:column>
				<p:column headerText="请款金额" width="100" >
					<h:outputText value="#{row.payAmount}" />
				</p:column>
				<p:column headerText="开票分配金额" width="100" >
					<h:outputText value="#{row.invAmount}" />
				</p:column>
				<p:column headerText="开票总金额" width="100" >
					<h:outputText value="#{row.amount}" />
				</p:column>
				<p:column headerText="开票状态" width="100" >
					<p:selectOneMenu value="#{row.status}"  disabled="true"	>
						<f:selectItems value="#{invInfoQueryMB.itemsInvStatus}" />
					</p:selectOneMenu>				
				</p:column>
				<p:column headerText="备注" width="100" >
					<h:outputText value="#{row.remarks}" />
				</p:column>
				
			</p:dataTable>
							
		</p:panel>
		
	</h:form>
	</ui:define>
</ui:composition>
